gtk4.git
9 years agoFixes for the gdk docs
Matthias Clasen [Wed, 21 Dec 2016 17:03:05 +0000 (12:03 -0500)]
Fixes for the gdk docs

9 years agoMake gsk docs build
Matthias Clasen [Wed, 21 Dec 2016 15:58:10 +0000 (10:58 -0500)]
Make gsk docs build

9 years agosnapshot: Fix some annoations
Rico Tzschichholz [Wed, 21 Dec 2016 17:16:34 +0000 (18:16 +0100)]
snapshot: Fix some annoations

9 years agogsk: Fix build of 22110ef5a480fbddf9d20f510a64f4524a52718f
Rico Tzschichholz [Wed, 21 Dec 2016 17:15:50 +0000 (18:15 +0100)]
gsk: Fix build of 22110ef5a480fbddf9d20f510a64f4524a52718f

9 years agoGskRenderNode: Use C99 flexible arrays to avoid extra allocation
Alexander Larsson [Wed, 21 Dec 2016 11:20:56 +0000 (12:20 +0100)]
GskRenderNode: Use C99 flexible arrays to avoid extra allocation

Instead of a separate allocation for any arrays in the render node
we allocate these as part of the render node itself, using C99
flexible arrays.

This leads to less allocations, which is nice, but the major reason
for this is that it allows us to change the allocation scheme further
in the future. For instance, we want to do stack-like allocation so
that all the render-nodes for an entire frame are allocated in one
(or a few) chunks.

9 years agogsk: Add bounds member to RenderNode
Alexander Larsson [Wed, 21 Dec 2016 10:21:38 +0000 (11:21 +0100)]
gsk: Add bounds member to RenderNode

Instead of constantly recalculating this (especially recursively for
parents!) we do it only on construction, because everything is
immutable anyway. Also, most nodes had a bounds already and can
use the new parent member instead.

We also do direct access to the node bounds rather than calling
gsk_render_node_get_bounds in various places, which means
we do less copying.

9 years agogsk: Drop gsk_render_node_make_immutable, nodes are always immutable
Alexander Larsson [Wed, 21 Dec 2016 10:00:18 +0000 (11:00 +0100)]
gsk: Drop gsk_render_node_make_immutable, nodes are always immutable

9 years agogsk docs: gsk_render_node_iter_get_type doesn't exist anymore
Alexander Larsson [Wed, 21 Dec 2016 09:59:35 +0000 (10:59 +0100)]
gsk docs: gsk_render_node_iter_get_type doesn't exist anymore

9 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Wed, 21 Dec 2016 10:56:38 +0000 (10:56 +0000)]
Update Kazakh translation

9 years agoUpdate German translation
Christian Kirbach [Tue, 20 Dec 2016 19:11:29 +0000 (19:11 +0000)]
Update German translation
(cherry picked from commit e0856226c580191805f58d0df10260df6b293df9)

9 years agodebug: Add GTK_DEBUG=snapshot
Benjamin Otte [Tue, 20 Dec 2016 18:20:02 +0000 (19:20 +0100)]
debug: Add GTK_DEBUG=snapshot

This causes the snapshotting algorithm to dump all widget nodes into
their own container node. We then name that group accordingly (ie
"GtkSwitch<0xdeadbeef>") so you can easily see which node belongs where.

The feature is toggleable in the inspector's visual tab.

There's a few problems with it, becuse GtkSnapshot optimized container
nodes away if they are not needed, so we are losing some widgets...

9 years agorevealer: Implement snapshot()
Benjamin Otte [Tue, 20 Dec 2016 18:06:07 +0000 (19:06 +0100)]
revealer: Implement snapshot()

The revealer needs to clip the child during animations, whcih draw() did
automatically, but snapshot() does not.

9 years agoAPI: Export gtk_container_snapshot_child()
Benjamin Otte [Tue, 20 Dec 2016 18:00:07 +0000 (19:00 +0100)]
API: Export gtk_container_snapshot_child()

It's equivalent to gtk_container_propagate_draw() and then one is
public, too.

9 years agodebug: Remove pixel-cache debug categories
Benjamin Otte [Tue, 20 Dec 2016 17:30:14 +0000 (18:30 +0100)]
debug: Remove pixel-cache debug categories

We have no more pixel cache, so they are kind of useless.

9 years agoflowbox: Don't emit child-activated while dragging the pointer
Debarshi Ray [Tue, 20 Dec 2016 11:55:41 +0000 (12:55 +0100)]
flowbox: Don't emit child-activated while dragging the pointer

https://bugzilla.gnome.org/show_bug.cgi?id=776306

9 years agocssimageradial: Handle "partial" gradients correctly
Benjamin Otte [Mon, 19 Dec 2016 22:30:02 +0000 (23:30 +0100)]
cssimageradial: Handle "partial" gradients correctly

When the first/last color stop is not at 0%/100%, we need to start the
repeating at their offsets and not at 0%/100%.

Attached reftest demonstrates the problem.

9 years agosearchbar: Implement snapshot()
Benjamin Otte [Mon, 19 Dec 2016 19:04:52 +0000 (20:04 +0100)]
searchbar: Implement snapshot()

9 years agogadget: Remove gtk_css_gadget_draw()
Benjamin Otte [Mon, 19 Dec 2016 18:45:34 +0000 (19:45 +0100)]
gadget: Remove gtk_css_gadget_draw()

And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.

9 years agocolorswatch: Implement snapshot
Benjamin Otte [Mon, 19 Dec 2016 18:30:55 +0000 (19:30 +0100)]
colorswatch: Implement snapshot

9 years agoroundedbox: Add gtk_rounded_boxes_init_for_style()
Benjamin Otte [Mon, 19 Dec 2016 18:19:15 +0000 (19:19 +0100)]
roundedbox: Add gtk_rounded_boxes_init_for_style()

Instead of making people intiialize a rectangle and then applying border
radius manually, provide a constructor that does it for them.
While doing that, also allow people to instead request the padding box
or the content box.

Refactor all relevant code to use this new constructor.

9 years agogtk: Remove GtkJunctionSides
Benjamin Otte [Mon, 19 Dec 2016 17:46:24 +0000 (18:46 +0100)]
gtk: Remove GtkJunctionSides

9 years agotestgtk: Remove resize grips example
Benjamin Otte [Mon, 19 Dec 2016 17:21:59 +0000 (18:21 +0100)]
testgtk: Remove resize grips example

Resize grips are gone. And just showing an empty window is not terribly
exciting.

9 years agoframe: Implement snapshot()
Benjamin Otte [Mon, 19 Dec 2016 16:42:27 +0000 (17:42 +0100)]
frame: Implement snapshot()

9 years agoiconview: Implement snapshot()
Benjamin Otte [Mon, 19 Dec 2016 16:16:09 +0000 (17:16 +0100)]
iconview: Implement snapshot()

9 years agocellview: Implement snapshot()
Benjamin Otte [Mon, 19 Dec 2016 15:34:25 +0000 (16:34 +0100)]
cellview: Implement snapshot()

This also adds gtk_cell_area_snapshot().

9 years agogsk: Add GskOutsetShadowNode
Benjamin Otte [Mon, 19 Dec 2016 14:39:43 +0000 (15:39 +0100)]
gsk: Add GskOutsetShadowNode

9 years agogsk: Add GskInsetShadowNode
Benjamin Otte [Mon, 19 Dec 2016 04:13:42 +0000 (05:13 +0100)]
gsk: Add GskInsetShadowNode

And again lots of shadow code gets copied to GSK. But we're now almost
at a stage where widget-factory does not use cairo nodes anymore.

9 years agogsk: Add contains/intersect functions for GskRoundedRect
Benjamin Otte [Mon, 19 Dec 2016 03:39:33 +0000 (04:39 +0100)]
gsk: Add contains/intersect functions for GskRoundedRect

... and use them.

9 years agogsk: Add GskShadowNode
Benjamin Otte [Sun, 18 Dec 2016 23:45:35 +0000 (00:45 +0100)]
gsk: Add GskShadowNode

... and make the icon rendering code use it.

This requires moving even more shadow renering code into GSK, but so be
it. At least the "shadows not implemented" warning is now gone!

9 years agoAPI: gdk: Add gdk_rgba_is_clear() and gdk_rgba_is_opaque()
Benjamin Otte [Sun, 18 Dec 2016 21:31:18 +0000 (22:31 +0100)]
API: gdk: Add gdk_rgba_is_clear() and gdk_rgba_is_opaque()

I want to use these inside GSK, and I'm not a fan of putting GdkRGBA
APIs into it or duplicating it into GTK.

So public API it is.

9 years agogsk: Move gtk/gtkcairoblur.c to gsk/gskcairoblur.c
Benjamin Otte [Sun, 18 Dec 2016 20:45:15 +0000 (21:45 +0100)]
gsk: Move gtk/gtkcairoblur.c to gsk/gskcairoblur.c

9 years agoinspector: Print node type in node properties
Benjamin Otte [Sun, 18 Dec 2016 17:17:17 +0000 (18:17 +0100)]
inspector: Print node type in node properties

9 years agogsk: Add GskBorderNode
Benjamin Otte [Sun, 18 Dec 2016 17:14:53 +0000 (18:14 +0100)]
gsk: Add GskBorderNode

The node draws a solid CSS border, which can be used to cover everything
but dashed and dotted borders (double, groove, inset, ...).

For different border styles, we overlay multiple nodes and set their
colors to transparent for sides with non-matching styles.

9 years agogtk: Remove unused argument from function
Benjamin Otte [Sun, 18 Dec 2016 16:52:47 +0000 (17:52 +0100)]
gtk: Remove unused argument from function

9 years agogsk: Add gsk_rounded_rect_shrink()
Benjamin Otte [Sun, 18 Dec 2016 16:10:45 +0000 (17:10 +0100)]
gsk: Add gsk_rounded_rect_shrink()

... and replace _gtk_rounded_box_grow() and _gtk_rounded_box_shrink()
with it.

9 years agovulkan: Get rid of color in push constants
Benjamin Otte [Sun, 18 Dec 2016 06:08:37 +0000 (07:08 +0100)]
vulkan: Get rid of color in push constants

The color comes in instance data now, no need to abuse push constants
for it.

9 years agovulkan: Remove color from push constants
Benjamin Otte [Sun, 18 Dec 2016 06:07:02 +0000 (07:07 +0100)]
vulkan: Remove color from push constants

It's now handled by the color pipeline.

9 years agovulkan: Pass color rects in instance data
Benjamin Otte [Sun, 18 Dec 2016 05:54:48 +0000 (06:54 +0100)]
vulkan: Pass color rects in instance data

This way, we don't need push constants or per-vertex data, we can render
colored rectangles completely via instance data.

9 years agovulkan: Don't pass texture coordinates to the color pipeline
Benjamin Otte [Sun, 18 Dec 2016 04:59:56 +0000 (05:59 +0100)]
vulkan: Don't pass texture coordinates to the color pipeline

9 years agovulkan: Get vertex description from pipeline subclass
Benjamin Otte [Sun, 18 Dec 2016 04:33:16 +0000 (05:33 +0100)]
vulkan: Get vertex description from pipeline subclass

9 years agovulkan: Split color and blend pipelines
Benjamin Otte [Sun, 18 Dec 2016 01:18:01 +0000 (02:18 +0100)]
vulkan: Split color and blend pipelines

9 years agovulkan: Move vertex data tracking to the pipeline subclass
Benjamin Otte [Sun, 18 Dec 2016 00:45:07 +0000 (01:45 +0100)]
vulkan: Move vertex data tracking to the pipeline subclass

That way, different pipelines can draw different kinds of data.

9 years agovulkan: Add GskVulkanBlendPipeline
Benjamin Otte [Sat, 17 Dec 2016 23:57:37 +0000 (00:57 +0100)]
vulkan: Add GskVulkanBlendPipeline

So far that's just a simple pipeline that doesn't do anything.

9 years agovulkan: Make GskVulkanPipeline derivable
Benjamin Otte [Sat, 17 Dec 2016 23:33:53 +0000 (00:33 +0100)]
vulkan: Make GskVulkanPipeline derivable

9 years agomenu: Implement snapshot() for the menu code
Benjamin Otte [Sat, 17 Dec 2016 19:46:25 +0000 (20:46 +0100)]
menu: Implement snapshot() for the menu code

9 years agopaned: Implement snapshot()
Benjamin Otte [Sat, 17 Dec 2016 19:29:41 +0000 (20:29 +0100)]
paned: Implement snapshot()

9 years agocssimage: Implement snapshot() for cross-fade
Benjamin Otte [Sat, 17 Dec 2016 07:07:29 +0000 (08:07 +0100)]
cssimage: Implement snapshot() for cross-fade

9 years agosnapshot: Implement gtk_snapshot_push_opacity()
Benjamin Otte [Sat, 17 Dec 2016 07:06:59 +0000 (08:06 +0100)]
snapshot: Implement gtk_snapshot_push_opacity()

Use it in GtkWidget's opacity handling.

9 years agosnapshot: Handle NULL returns in pop_and_append()
Benjamin Otte [Sat, 17 Dec 2016 07:03:43 +0000 (08:03 +0100)]
snapshot: Handle NULL returns in pop_and_append()

9 years agogsk: Add cross-fade node
Benjamin Otte [Sat, 17 Dec 2016 06:44:10 +0000 (07:44 +0100)]
gsk: Add cross-fade node

And implement stack crossfades with it.

9 years agovulkan: Batch upload image barriers together
Benjamin Otte [Sat, 17 Dec 2016 03:54:19 +0000 (04:54 +0100)]
vulkan: Batch upload image barriers together

Doesn't seem to help much though...

9 years agovulkan: Add GskVulkanUploader
Benjamin Otte [Sat, 17 Dec 2016 03:22:44 +0000 (04:22 +0100)]
vulkan: Add GskVulkanUploader

It's the thing that makes sure pixels end up on the GPU.

9 years agovulkan: Split out command pool
Benjamin Otte [Fri, 16 Dec 2016 05:10:24 +0000 (06:10 +0100)]
vulkan: Split out command pool

This way we can pass the command pool around.
And that allows us to allocate and submitcustom buffers.
And that is necessary to make staging images work.

9 years agovulkan: Implement staging-buffer image upload
Benjamin Otte [Thu, 15 Dec 2016 23:22:23 +0000 (00:22 +0100)]
vulkan: Implement staging-buffer image upload

This is not enabled by default. Use GSK_RENDERING_MODE=staging-buffer to
use the code.

9 years agosnapshot: Convert Range, Scale, ColorScale
Benjamin Otte [Thu, 15 Dec 2016 09:09:41 +0000 (10:09 +0100)]
snapshot: Convert Range, Scale, ColorScale

And of course Scrollbar, but that one does no drawing itself.

9 years agogsk: Check for NULL in calls to gsk_cairo_node_get_surface()
Benjamin Otte [Thu, 15 Dec 2016 09:08:46 +0000 (10:08 +0100)]
gsk: Check for NULL in calls to gsk_cairo_node_get_surface()

That function does actually sometimes return NULL and is documented to
do so, so handle that case in the renderers (by omitting the node).

9 years agogsk: Implement linear gradient render nodes
Benjamin Otte [Thu, 15 Dec 2016 04:42:31 +0000 (05:42 +0100)]
gsk: Implement linear gradient render nodes

9 years agogsk: Add blend nodes
Benjamin Otte [Thu, 15 Dec 2016 03:24:37 +0000 (04:24 +0100)]
gsk: Add blend nodes

Implement blend mode support in GTK background compositing with it.

9 years agocss: Replace custom blend modes with GskBlendMode
Benjamin Otte [Thu, 15 Dec 2016 03:20:35 +0000 (04:20 +0100)]
css: Replace custom blend modes with GskBlendMode

9 years agogsk: Add missing blend modes
Benjamin Otte [Thu, 15 Dec 2016 03:19:03 +0000 (04:19 +0100)]
gsk: Add missing blend modes

This brings GSK blend modes in line with the CSS spec.

9 years agovulkan: Add infrastructure for multiple pipelines
Benjamin Otte [Wed, 14 Dec 2016 08:40:15 +0000 (09:40 +0100)]
vulkan: Add infrastructure for multiple pipelines

And use it to draw solid colors with a 2nd pipeline.

9 years agovulkan: Split PipelineLayout into its own object
Benjamin Otte [Wed, 14 Dec 2016 07:00:58 +0000 (08:00 +0100)]
vulkan: Split PipelineLayout into its own object

This way, we can share the layout between different pipelines.

9 years agovulkan: Split render ops into seperate structs
Benjamin Otte [Wed, 14 Dec 2016 06:34:18 +0000 (07:34 +0100)]
vulkan: Split render ops into seperate structs

This makes it a lot clearer which members are relevant for each
different operation.

9 years agovulkan: Add infrastructure for push constants
Benjamin Otte [Wed, 14 Dec 2016 06:21:21 +0000 (07:21 +0100)]
vulkan: Add infrastructure for push constants

THe code includes fragment push constants for colors, but that code is
so far unused.

9 years agocssimage: Port a few more simple ones to snapshots
Benjamin Otte [Wed, 14 Dec 2016 03:55:24 +0000 (04:55 +0100)]
cssimage: Port a few more simple ones to snapshots

9 years agorender: Fall back later when rendering backgrounds
Benjamin Otte [Tue, 13 Dec 2016 23:08:29 +0000 (00:08 +0100)]
render: Fall back later when rendering backgrounds

We can now render most backgrounds fine.

9 years agogtk: Fix memleaks
Benjamin Otte [Tue, 13 Dec 2016 23:06:01 +0000 (00:06 +0100)]
gtk: Fix memleaks

It turns out, some simple getters - such as
gdk_drawing_context_get_clip() - love copying things before returning
them.

I guess somebody has to burn cycles...

9 years agocss: An opaque background does not allow omitting push_group
Benjamin Otte [Tue, 13 Dec 2016 22:00:26 +0000 (23:00 +0100)]
css: An opaque background does not allow omitting push_group

When the background-clip of the background is smaller than the
background-clip of blended images, not pushing a group is wrong.

Test testing exactly that included.

9 years agogsk: Add support for rounded clip rectangles
Benjamin Otte [Tue, 13 Dec 2016 20:59:28 +0000 (21:59 +0100)]
gsk: Add support for rounded clip rectangles

Also add support to GtkSnapshot, so people can push rounded clips.

9 years agoroundedbox: Remove _gtk_rounded_box_path()
Benjamin Otte [Tue, 13 Dec 2016 20:00:28 +0000 (21:00 +0100)]
roundedbox: Remove _gtk_rounded_box_path()

Use gsk_rounded_rect_path() instead.

That's a private GSK function, be we can just include its header.

9 years agoroundedbox: Remove _gtk_rounded_box_move()
Benjamin Otte [Tue, 13 Dec 2016 19:51:57 +0000 (20:51 +0100)]
roundedbox: Remove _gtk_rounded_box_move()

Use gsk_rounded_rect_offset() instead.

9 years agogtk: Remove GtkRoundedBox struct
Benjamin Otte [Tue, 13 Dec 2016 19:48:58 +0000 (20:48 +0100)]
gtk: Remove GtkRoundedBox struct

Use GskRoundedRect instead.

9 years agoroundedbox: typedef to GskRoundedRect
Benjamin Otte [Tue, 13 Dec 2016 19:36:00 +0000 (20:36 +0100)]
roundedbox: typedef to GskRoundedRect

9 years agoroundedbox: Use a graphene_size_t for the corners
Benjamin Otte [Tue, 13 Dec 2016 19:15:01 +0000 (20:15 +0100)]
roundedbox: Use a graphene_size_t for the corners

Obviously, I'm trying to port GtkRoundedBox to GskRoundedRect.

This is the second step on that path.

9 years agogtk: Get rid of GtkCssCorner
Benjamin Otte [Tue, 13 Dec 2016 18:54:40 +0000 (19:54 +0100)]
gtk: Get rid of GtkCssCorner

We have GskCorner now which is identical.

9 years agogsk: Add GskRoundedRect
Benjamin Otte [Tue, 13 Dec 2016 18:02:12 +0000 (19:02 +0100)]
gsk: Add GskRoundedRect

It's essentially a port of GtkRoundedBox to graphene.

9 years agoviewport: implement snapshot()
Benjamin Otte [Tue, 13 Dec 2016 15:19:14 +0000 (16:19 +0100)]
viewport: implement snapshot()

9 years agostack: Implement snapshot()
Benjamin Otte [Tue, 13 Dec 2016 08:45:09 +0000 (09:45 +0100)]
stack: Implement snapshot()

This uses the new push()/pop() mechanism to its fullest extent when
implementing transitions. It's fun to inspect the results in the
inspector.

Crossfades don't work yet, they continue using a Cairo fallback.

A side effect of the stack conversion is that widget-factory now uses
snapshots for a lot more things.

9 years agosnapshot: Work on pushing and popping again
Benjamin Otte [Tue, 13 Dec 2016 08:40:24 +0000 (09:40 +0100)]
snapshot: Work on pushing and popping again

It is now possible to call push() subfunctions for simple container
nodes with just a single child. So you can for example
gtk_snapshot_push_clip() a clip region that all the nodes that get
appended later will then obey.

gtk_snapshot_pop() will then not return a container node, but a clip
node containing the container node (and similar for the transform
example).

This is implemented internally by providing a "collect function" when
pushing that is called when popping to collects all the accumulated
nodes and combine them into the single node that gets returned.

To simplify things even more, gtk_snapshot_pop_and_append() has been
added, which pops the currently pushed node and appends it to the
parent.

The icon rendering code has been converted to this approach.

9 years agogsk: Add gsk_clip_node_new()
Benjamin Otte [Tue, 13 Dec 2016 08:37:51 +0000 (09:37 +0100)]
gsk: Add gsk_clip_node_new()

The node is a simple clipping node: It does a rectangular clip of its
contents.

9 years agostack: Don't draw an extra background
Benjamin Otte [Tue, 13 Dec 2016 04:55:42 +0000 (05:55 +0100)]
stack: Don't draw an extra background

The gadget draws a background for us, we don't need another one.

9 years agogsk: Replace gsk_render_node_set_opacity()
Benjamin Otte [Tue, 13 Dec 2016 04:49:57 +0000 (05:49 +0100)]
gsk: Replace gsk_render_node_set_opacity()

... with gsk_opacity_node_new().

Also implement support for opacity in gtk_widget_snapshot() using this
new node.

9 years agocssimage: Implement snapshot() in the fallback image
Benjamin Otte [Tue, 13 Dec 2016 04:12:41 +0000 (05:12 +0100)]
cssimage: Implement snapshot() in the fallback image

9 years agocssimage: Use textures in GtkCssImageSurface
Benjamin Otte [Tue, 13 Dec 2016 04:11:59 +0000 (05:11 +0100)]
cssimage: Use textures in GtkCssImageSurface

We now use textures instead of surfaces and implement the snapshot()
vfunc instead of draw().

9 years agocssimage: Implement a fallback draw() vfunc
Benjamin Otte [Tue, 13 Dec 2016 04:10:05 +0000 (05:10 +0100)]
cssimage: Implement a fallback draw() vfunc

... that chains into snapshot. This way, we can stop implementing draw()
in GtkCssImage subclasses and focus on snapshot() instead.

9 years agosnapshot: Make gtk_snapshot_get_renderer() private
Benjamin Otte [Tue, 13 Dec 2016 04:08:40 +0000 (05:08 +0100)]
snapshot: Make gtk_snapshot_get_renderer() private

Public API doesn't need to be concerned with renderers. Worst case, they
can use NULL instead of the actual renderer.

9 years agogsk: Remove gsk_renderer_create_fallback()
Benjamin Otte [Tue, 13 Dec 2016 04:07:43 +0000 (05:07 +0100)]
gsk: Remove gsk_renderer_create_fallback()

Use gsk_render_node_draw() instead.

9 years agosnapshot: Add API for colors and textures
Benjamin Otte [Tue, 13 Dec 2016 03:22:13 +0000 (04:22 +0100)]
snapshot: Add API for colors and textures

9 years agogsk: Add fallback code to renderers
Benjamin Otte [Tue, 13 Dec 2016 03:20:04 +0000 (04:20 +0100)]
gsk: Add fallback code to renderers

This code makes renderers fall back to Cairo rendering if they don't
know how to handle a render node's type.

This allows adding new render nodes with impunity.

9 years agogsk: Add gsk_color_node_new()
Benjamin Otte [Tue, 13 Dec 2016 02:35:56 +0000 (03:35 +0100)]
gsk: Add gsk_color_node_new()

9 years agoCall gsk_render_node_draw() instead of creating fallback renderers
Benjamin Otte [Tue, 13 Dec 2016 02:15:07 +0000 (03:15 +0100)]
Call gsk_render_node_draw() instead of creating fallback renderers

9 years agogsk: Add gsk_render_node_draw()
Benjamin Otte [Tue, 13 Dec 2016 02:05:15 +0000 (03:05 +0100)]
gsk: Add gsk_render_node_draw()

Draws a node to a given cairo_t. This is mostly intended for fallback
usage.

9 years agosnapshot: Change how gtk_snapshot_push/pop works
Benjamin Otte [Tue, 13 Dec 2016 01:33:15 +0000 (02:33 +0100)]
snapshot: Change how gtk_snapshot_push/pop works

Instead of appending a container node and adding the nodes to it as they
come in, we now collect the nodes until gtk_snapshot_pop() is called and
then hand them out in a container node.

The caller of gtk_snapshot_push() is then responsible for doing whatever
he wants with the created node.

Another addigion is the keep_coordinates flag to gtk_snapshot_push()
which allows callers to keep the current offset and clip region or
discard it. Discarding is useful when doing transforms, keeping it is
useful when inserting effect nodes (like the ones I'm about to add).

9 years agosnapshot: Handle clip region as part of the state
Benjamin Otte [Tue, 13 Dec 2016 00:44:52 +0000 (01:44 +0100)]
snapshot: Handle clip region as part of the state

This is in preparation for further changes.

9 years agogsk: gsk_render_node_set_transform() => GskTransformNode
Benjamin Otte [Mon, 12 Dec 2016 23:11:06 +0000 (00:11 +0100)]
gsk: gsk_render_node_set_transform() => GskTransformNode

Instead of having a setter for the transform, have a GskTransformNode.

Most of the oprations that GTK does do not require a transform, so it
doesn't make sense to have it as a primary attribute.

Also, changing the transform requires updating the uniforms of the GL
renderer, so we're happy if we can avoid that.

9 years agogsK: Move children handling to GskContainerNode
Benjamin Otte [Mon, 12 Dec 2016 18:30:41 +0000 (19:30 +0100)]
gsK: Move children handling to GskContainerNode

9 years agogsk: Remove GskRenderNode::parent
Benjamin Otte [Mon, 12 Dec 2016 17:54:49 +0000 (18:54 +0100)]
gsk: Remove GskRenderNode::parent

... and all related APIs.

9 years agoinspector: Prepare TreeModelRenderNode for brave new world
Benjamin Otte [Mon, 12 Dec 2016 17:53:41 +0000 (18:53 +0100)]
inspector: Prepare TreeModelRenderNode for brave new world

I'm about to move children handling to the container node, which means
the generic code can no longer assume children APIs existing.

So rewrite the treemodel to work without it.

9 years agogsk: Remove world matrix support
Benjamin Otte [Mon, 12 Dec 2016 15:52:55 +0000 (16:52 +0100)]
gsk: Remove world matrix support

Use the real transform and compute it manually.

9 years agogsk: Remove gsk_render_node_set_bounds()
Benjamin Otte [Mon, 12 Dec 2016 05:29:04 +0000 (06:29 +0100)]
gsk: Remove gsk_render_node_set_bounds()

gsk_render_node_get_bounds() still exists and is computed via vfunc
call:
- containers dynamically compute the bounds from their children
- surface and texture nodes get bounds passed on construction